home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
crit.arc
/
TESTCRIT.C
< prev
Wrap
C/C++ Source or Header
|
1986-12-01
|
689b
|
26 lines
#include <stdio.h>
main(argc,argv)
int argc;
char **argv;
{
FILE *foo = NULL;
static char fnamebuf[65];
/* attempt to open the file specified by the first command line
** argument
*/
sprintf(fnamebuf,"A:%s",argv[1]); /* build the file name */
for (;foo == NULL;)
{
if (-1 == setup_crit()) /* set up error handler */
{
/* if an error occurs, you will end up here */
fprintf(stderr,"Check to make sure a valid disk is drive A:\n");
fprintf(stderr,"and that the drive door is closed\n");
fprintf(stderr,"Hit return to continue\n");
getchar();
}
foo = fopen(fnamebuf,"r");
}
restore_crit(); /* turn off critical error handling */
}